#pragma once

#include <AVUISelector.h>
#include <AVUIHeaderedContentControl.h>

namespace AVUI {

class TabItem : public HeaderedContentControl
{
public:
    TabItem() { };
    ~TabItem() { };

    DECLARE_ELEMENT(TabItem, HeaderedContentControl);

    DECLARE_DEPENDENCY_PROPERTY(IsSelected);
    bool get_IsSelected() { return AVUI::UnboxValue<bool>(GetValue(get_IsSelectedProperty())); }
    void set_IsSelected(bool value) { SetValue(get_IsSelectedProperty(), AVUI::BoxValue(value)); } 

protected:

    virtual void OnSelected(RoutedEventArgs* pArgs);
    virtual void OnUnselected(RoutedEventArgs* pArgs);

    virtual void OnMouseDown(MouseButtonEventArgs* pArgs);

private:
    static void StaticConstructor();

    void HandleIsSelectedChanged(bool newValue, RoutedEventArgs* pArgs);
    static void OnIsSelectedChanged(DependencyObject* pDO, DependencyPropertyChangedEventArgs* e);
    bool SetFocus();



};

}; // namespace AVUI
